package com.lzh.others.basejava.Thread_21.utils;

import java.util.StringJoiner;

/**
 * @Description:
 * @Author: LiuZiHao
 * @Date: 2022/12/28 15:27
 */
public class SmallTool {
    public static void sleepMillis(long millis) {
        try {
            Thread.sleep(millis);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void printTimeAndThread(String tag) {
        String toString = new StringJoiner("\t|\t")
                .add(String.valueOf(System.currentTimeMillis()))
                .add(String.valueOf(Thread.currentThread().getId()))
                .add(Thread.currentThread().getName())
                .add(tag).toString();
        System.out.println("toString = " + toString);
    }
}
